import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import {lendingRoutes} from "@/views/lending/router/lendingRoutes";//病案登记模块的路由
const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    redirect: '/record/medicalHome',
    children:[
      {path: '/record/medicalHome',component:()=>import('../views/record/MedicalHomeView.vue')},
      {path: '/record/medicalCreate',component:()=>import('../views/record/MedicalCreate.vue')},
      //病案复印组
        {
            path:'/duplicate/medicalDuplicate',
            redirect:'/duplicate/medicalDuplicate/manage',
            children:[
                {path:'manage', component:()=>import('@/views/duplicate/medical_duplicate/MedicalDuplicateView.vue')},
                {path:'detail', component:()=>import('@/views/duplicate/medical_duplicate/DuplicateDetail.vue')},
                {path:'create', component:()=>import('@/views/duplicate/medical_duplicate/CreateDuplicate.vue')},
            ]
        },
        //复印模板组
        {
            path: '/duplicate/copyingPurposes',
            redirect: '/duplicate/copyingPurposes/manage',
            children: [
                {path: 'manage',component:()=>import('../views/duplicate/copy_purposes/CopyingPurposesView.vue')},
                {path: 'create',component:()=>import('../views/duplicate/copy_purposes/CreateTemplate.vue')},
            ]
        },
      {path: '/index',component:()=>import('../views/statistics/DuplicateStatisticalView.vue')},
      {path: '/duplicate/basicInformation',component:()=>import('../views/duplicate/basic_info/BasicInformationView.vue')},
      {path: '/duplicate/copyContent',component:()=>import('../views/duplicate/copy_content/CopyContentView.vue')},
        /*考虑扩展功能问题,将以外部引入的形式引入lending相关路由,避免路由冲突
      {path: '/lending/lendingRegister',component:()=>import('../views/lending/LendingRegisterView.vue')},
      {path: '/lending/borrowingAudit',component:()=>import('../views/lending/BorrowingAuditView.vue')},
      {path: '/lending/borrowingReturn',component:()=>import('../views/lending/BorrowingReturnView.vue')},*/
        ...lendingRoutes,
      {path: '/statistics/duplicateStatistical',component:()=>import('../views/statistics/DuplicateStatisticalView.vue')},
      {path: '/statistics/lendingRegisterStatistical',component:()=>import('../views/statistics/LendingRegisterStatisticsView.vue')},
      {path: '/statistics/returnRegisterStatistical',component:()=>import('../views/statistics/ReturnRegisterStatisticsView.vue')},
      {path: '/expense/duplicateExpense',component:()=>import('../views/expense/DuplicateExpenseView.vue')},
      {path: '/expense/monthlyBills',component:()=>import('../views/expense/MonthlyBillsView.vue')},
      {path: '/system/dictionary',component:()=>import('../views/system/DictionaryView.vue')},
      {path: '/system/classificationDiseases',component:()=>import('../views/system/ClassificationDiseasesView.vue')},
      {path: '/system/answersQuestionView',component:()=>import('../views/system/AnswersQuestionView.vue')},
      {path: '/system/user',component:()=>import('../views/system/UserView.vue')},
      {path: '/system/user/addUser',component:()=>import('../views/system/AddUserView.vue')},
      {path: '/system/loginLog',component:()=>import('../views/system/LoginLogView.vue')},

    ]
  },
  {path: '/', component:()=>import('../views/LoginView.vue')},
  {path: '/login',component: ()=>import('../views/LoginView.vue')},
  {path: '/personalHomepage',component: ()=>import('../views/others/PersonalHomepageView.vue')},
  {path: '/messageCenter',component: ()=>import('../views/others/MessageCenterView.vue')},
  {path: '/settings',component:()=>import('../views/others/SettingsView.vue')}
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router
